#ifndef ABSTRACTPANEL_H
#define ABSTRACTPANEL_H

#include "AbstractShapeItem.h"
#include <vector>

class AbstractManager;
class GraphicsText;
class PanelItem;

class AbstractPanel : public AbstractShapeItem
{
	Q_OBJECT

public:
	const static int TITLE_BLOCK_HEIGHT = 34;

	AbstractPanel( std::string, AbstractManager* manager );
	~AbstractPanel();
	void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
	QRectF boundingRect() const;
	QString getTitleString();
	void setTitleString(QString);
	virtual void deleteItem(PanelItem*);
	void insertItem(PanelItem*);
	void insertItem(PanelItem*, int);
	void updateItemsPosition();
	std::vector<PanelItem*>& getItems();
	int indexOfItem(PanelItem*);

protected:
	GraphicsText *_title;
	std::vector<PanelItem*> _itemList;

	virtual void init()=0;
	void initTitle(QString, bool);
	void setItemColor( int, AbstractShapeItem * );
};

#endif // ABSTRACTPANEL_H
